package com.spsoft.vatoutinv.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 授信额度变更类型枚举类
 *
 * @author : chenxudong
 * @date : 2024/4/19 10:45
 */
@Getter
@AllArgsConstructor
public enum SxedUpdateEnum {

    SXED_XZ("01", "下载"),
    SXED_TH("02", "退回"),
    SXED_BLUE("03", "开具蓝票"),
    SXED_RED("04", "开具红票"),
    SXED_BLUE_ROLLBACK("05", "回滚蓝票"),
    SXED_RED_ROLLBACK("06", "回滚红票"),
    SXED_SELECT("07", "查询乐企");

    private final String code;
    private final String name;

    // 根据code获取name
    public static String getNameByCode(String code){
        if (code == null) {
            return null;
        }
        for (SxedUpdateEnum status : SxedUpdateEnum.values()) {
            if(status.getCode().equals(code)){
                return status.getName();
            }
        }
        return null;
    }
}
